<template>
	<view>
		<view class="content">
			<view class="bg">
				<view class="FKM">
					FKM
				</view>
				<view class="inp">
					<view class="con">
						<view class="input">
							<input type="text" value="13000000000" v-model="from.username" />
							<view class="tel">
								手机号
							</view>
						</view>
						<view class="input">
							<input type="text" placeholder="请输入密码" v-model="from.pass" />
						</view>
					</view>
					<view class="but" @click="but">
						登录
					</view>
					<view class="radio">
						<checkbox-group>
							<label>
								<checkbox value="cb" checked="true" @click="isArout=!isArout"/>
							</label>
						</checkbox-group>
						<view class="my">
							我已阅读并同意<view class="abc">《FKM用户协议》《FKM隐私政策》</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {login} from '@/apis/index.js'
	export default {
		data() {
			return {
			from:{},
			isArout:true
			};
		},
		methods:{
			async but(){
				if(!this.from.username) return uni.showToast({
					title:'请输入账号',
					icon:'error'
				})
				if(!this.from.pass) return uni.showToast({
					title:'请输入密码',
					icon:'error'
				})
				
				if (!this.isArout) return uni.showToast({
					title:'请勾选协议',
					icon:'error'
				})
				let str = await login(this.from)
				console.log(str);
				if(str.errCode=='10000') {
					uni.switchTab({
						url:'/pages/shouye/shouye'
					})
					uni.setStorageSync('token',str.data.token)
				}
			}
		}
	}
</script>

<style lang="less">
	page {
		width: 100%;
		height: 100%;
	}

	.content {
		.bg {
			height: 510rpx;
			// width:750rpx;
			width: 100%;
			background-color: #d53225;

			.FKM {
				font-size: 55rpx;
				color: #ffffff;
				padding-top: 200rpx;
				text-align: center;
			}

			.inp {
				height: 605rpx;
				margin-top: 80rpx;
				margin-left: 36rpx;
				margin-right: 36rpx;
				background-color: #fff;
				border-radius: 17rpx;
				overflow: hidden;

				.con {
					margin-top: 41rpx;
					margin-left: 46rpx;
					margin-right: 46rpx;

					.input {
						height: 120rpx;
						position: relative;
						border-bottom: 3rpx solid #f1f1f1;

						input {
							height: 100%;
						}

						.tel {
							position: absolute;
							top: 0;
							font-size: 23rpx;
							color: #f19f68;
						}
					}
				}

				.but {
					font-size: 30rpx;
					margin-left: 25rpx;
					margin-right: 25rpx;
					background-color: #fa775e;
					padding-top: 33rpx;
					padding-bottom: 33rpx;
					border-radius: 50rpx;
					text-align: center;
					color: #fff;
					margin-top: 85rpx;
				}
				.radio{
						display: flex;
						margin-left: 25rpx;
						margin-top: 56rpx;
					.my{
						font-size: 20rpx;
						display: flex;
						font-size: #b1b0b0;
						margin-top: 10rpx;
						.abc{
							color: #dd5c52;
						}
					}
				}
			}
		}

	}
	/deep/uni-checkbox .uni-checkbox-input{
		height: 20rpx !important;
		width: 20rpx !important;
	}
</style>